package com.wzk.controller;

import com.wzk.pojo.ClazzSizeOption;
import com.wzk.pojo.JobOption;
import com.wzk.pojo.Result;
import com.wzk.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("获取员工岗位数据");
        JobOption jobOption= reportService.getEmpJobData();
        return Result.success(jobOption);
    }
    @GetMapping("/empGenderData")
    public Result getEmpGenderDate(){
        log.info("获取员工性别数据");
        List<Map<String,Object>> list= reportService.getEmpGenderData();
        return Result.success(list);
    }
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        log.info("获取学生学历数据");
        List<Map<String,Object>> list= reportService.getStudentDegreeData();
        return Result.success(list);
    }
    @GetMapping("studentCountData")
    public Result getClazzData(){
        log.info("获取学生班级数据");
        ClazzSizeOption clazzSizeOption= reportService.getClazzData();
        return Result.success(clazzSizeOption);
    }
}
